<template>
  <page-container>
    <el-card shadow="never">
      <template #header>
        数据筛选
      </template>
      <el-form
        :inline="true"
        ref="form"
      >
        <el-form-item label="分类">
          <el-input
            clearable
            placeholder="请输入分类内容"
          />
        </el-form-item>
        <el-form-item>
          <el-button native-type="submit">
            查询
          </el-button>
        </el-form-item>
      </el-form>
    </el-card>
    <el-card shadow="never">
      <template #header>
        <el-button
          type="primary"
          @click="dialogVisible = true"
        >
          新增分类
        </el-button>
      </template>
      <el-table
        :data="list"
        stripe
        style="width: 100%"
      >
        <el-table-column
          prop="project_name"
          label="项目内容"
          min-width="180"
        />
        <el-table-column
          prop="customer_name"
          label="所属客户"
          align="center"
        />
        <el-table-column
          prop="project_cate"
          label="项目类别"
          align="center"
        />
        <el-table-column
          prop="statrup_time"
          label="启动日期"
          align="center"
        />
        <el-table-column
          prop="deliver_time"
          label="交付日期"
          align="center"
        />
        <el-table-column
          prop="terminal_cate"
          label="终端类别"
          align="center"
        />
        <el-table-column
          prop="status"
          label="状态"
          align="center"
        />
        <el-table-column
          prop="stage"
          label="阶段"
          align="center"
        />
        <el-table-column
          prop="project_pm"
          label="负责人"
          align="center"
        />
        <el-table-column
          label="操作"
          fixed="right"
          min-width="100"
          align="center"
        >
          <template #default>
            <el-button type="text">
              添加成员
            </el-button>
            <el-button type="text">
              项目设置
            </el-button>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
    <list-form
      v-model="dialogVisible"
      @success="handleSuccess"
    />
  </page-container>
</template>
<script lang="ts" setup>
import { onMounted, ref } from 'vue'
import { getArticleList } from '@/api/cms'
import listForm from './listform.vue'

const list = ref<any[]>([]) // 公告列表

const dialogVisible = ref(false)

const getList = async () => {
  const data = await getArticleList()
  list.value = data
}

const handleSuccess = () => {
  dialogVisible.value = false
  getList()
}

onMounted(() => {
  getList()
})

</script>

<style lang="scss" scoped></style>
